package com.twu.biblioteca;

import java.util.ArrayList;

public class Library {

    private static final String EMPTY_LIBRARY_MESSAGE = "No Books to List\n";
    private final ArrayList<Book> books;

    public Library() {
        this.books = new ArrayList<Book>();
    }

    public ArrayList<Book> getBooks() {
        return books;
    }

    public String getBookListAsString() {
        boolean empty = true;
        String listString = "";

        for (Book book : books) {
            if (!book.isCheckedOut()) {
                listString += book.toString() + "\n";
                empty = false;
            }
        }

        if (empty)
            return EMPTY_LIBRARY_MESSAGE;
        return listString;
    }
}
